# 需求：8位老师，3个办公室，将8位老师随机分配到3个办公室

# 1、准备数据
teachers = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
offices = [[], [], []]

# 2、随机分配
import random

for name in teachers:
    num = random.randint(0, 2)
    offices[num].append(name)

# 3、检验分配成果
i = 1
print(offices)
for office in offices:
    print(f'办公室{i}的人数是{len(office)}，老师分别是：')
    i += 1
    for name in office:
        print(name)
